//
//  SettingsView.swift
//  NJU QR
//
//  Created by 许煜恒 on 8/14.
//

import SwiftUI

struct SettingsView: View {
    @AppStorage("login_cookie")
    private var login_cookie:String=""
    
    @State private var login_cookie_draft:String=""
    
    var body: some View {
        Form{
            TextField("Login cookie", text: $login_cookie_draft)
        }
        .onAppear {
            login_cookie_draft=login_cookie
        }
        .onDisappear {
            login_cookie=login_cookie_draft
        }
    }
}

struct SettingsView_Previews: PreviewProvider {
    static var previews: some View {
        SettingsView()
    }
}
